package shopping.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import shopping.dao.IMenuDao;
import shopping.entity.Menu;
import shopping.service.interfaces.IMenuService;

@Service("menuServiceImpl")
public class MenuServiceImpl implements IMenuService{

	@Resource
	private IMenuDao menuDao;
	
	@Override
	public void save(Menu menu) {
		menuDao.save(menu);
	}

	@Override
	public void deleteById(Menu menu) {
		menuDao.deleteById(menu);
	}

	@Override
	public void update(Menu menu) {
		menuDao.update(menu);
	}

	@Override
	public List<Menu> findByHql(Class<Menu> cla, Map<String, Object> map) {
		return menuDao.findByHql(cla, map);
	}
	
	@Override
	public Menu queryById(int id){
		return menuDao.queryById(Menu.class,id);
	}

	@Override
	public List<Menu> findByHqlPage(Map<String, Object> columsAndValues, int offset, int pageSize) {
		return menuDao.findByHqlPage(Menu.class, columsAndValues, offset, pageSize);
	}

	@Override
	public int countByHql(Map<String, Object> columsAndValues) {
		return menuDao.countByHql(Menu.class, columsAndValues);
	}
	
}
